package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Comments;
import cn.wolfcode.trip.base.query.CommentQuery;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CommentsMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Comments record);

    Comments selectByPrimaryKey(Long id);

    List<Comments> selectAll();

    int updateByPrimaryKey(Comments record);

    List<Comments> selectForList(CommentQuery qo);

    List<Comments> selectCommentsByStrategyId(@Param("strategyId") Long strategyId);

    List<Comments> selectUserByComment(Long id);

    // 通过当前用户id查询他未读的评论
    List<Comments> getMessagesByType(Long userId);
    // 将未读评论设置为已读
    void updateMessageState(Integer state);

    List<Comments> selectMessages(Long userId);

    List<Comments> selectMycomments(Long userId);
}